package com.transitionseverywhere.utils;

import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.PointF;

/* loaded from: classes.dex */
public class PathAnimatorCompat extends BasePointFAnimator {
    private float mPathLength;
    private PathMeasure mPathMeasure;
    private float[] mTempArray;

    private PathAnimatorCompat(Object obj, PointFProperty pointFProperty) {
        super(obj, pointFProperty);
        this.mTempArray = new float[2];
    }

    public static <T> PathAnimatorCompat ofPointF(T t, PointFProperty<T> pointFProperty, Path path) {
        if (t == null || pointFProperty == null || path == null) {
            return null;
        }
        PathAnimatorCompat pathAnimatorCompat = new PathAnimatorCompat(t, pointFProperty);
        pathAnimatorCompat.mPathMeasure = new PathMeasure(path, false);
        pathAnimatorCompat.mPathLength = pathAnimatorCompat.mPathMeasure.getLength();
        return pathAnimatorCompat;
    }

    @Override // com.transitionseverywhere.utils.BasePointFAnimator
    protected void applyAnimatedFraction(PointF pointF, float f) {
        if (f < 0.0f) {
            f = 0.0f;
        }
        if (f > 1.0f) {
            f = 1.0f;
        }
        this.mPathMeasure.getPosTan(f * this.mPathLength, this.mTempArray, null);
        float[] fArr = this.mTempArray;
        pointF.set(fArr[0], fArr[1]);
    }
}
